const user = require("../../model/user")
const {SUCCESS, FAILED} = require("../../enumeration/code")
module.exports = async ctx => {
  let data = ctx.request.body
  let res = await user.get(data)
  if (res.type == false) {
    ctx.body = {code: FAILED, data: res.data, msg: res.msg}
  } else {
    ctx.body = {code: SUCCESS, data: res.data, msg: res.msg}
  }
}
